package com.hsj.goldstore.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.hsj.goldstore.R;
import com.hsj.goldstore.bean.GoodsBean;
import com.hsj.goldstore.bean.LoginBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/3/26.
 */

public class BuyRecordAdapter extends RecyclerView.Adapter<BuyRecordAdapter.BuyReordViewHolder> {
    private List<GoodsBean> list = new ArrayList<>();
    private Context context;

    public BuyRecordAdapter(Context context, List<GoodsBean> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public BuyReordViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        BuyReordViewHolder holder = new BuyReordViewHolder(LayoutInflater.from(context)
                .inflate(R.layout.item_buy_record, parent, false));
        return holder;
    }

    @Override
    public void onBindViewHolder(BuyReordViewHolder holder, int position) {
        holder.ivPic.setImageResource(R.mipmap.ic_zb_3);
    }

    @Override
    public int getItemCount() {
        return list.size() + 10;
    }

    class BuyReordViewHolder extends RecyclerView.ViewHolder {
        TextView tvName, tvPrice;
        ImageView ivPic;

        public BuyReordViewHolder(View itemView) {
            super(itemView);
            tvName = itemView.findViewById(R.id.tv_name);
            tvPrice = itemView.findViewById(R.id.tv_price);
            ivPic = itemView.findViewById(R.id.iv_pic);
        }
    }


}
